﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="HomePage.aspx.cs" Inherits="MAA.Presentation.HomePage" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <link href="Styles/HomePage.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <tbody>
        <tr>
            <td align="left" valign="top" class="mainTable_boder">
                <div class="mainTable_search">
                    <form id="searchPost" action="">
                    <div class="riceTypeSearch_HomePage">
                        <asp:Label ID="langRiceType" runat="server" Text="<%$Resources:language, langRiceType%>"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlRiceType" runat="server" Width="150px">
                        </asp:DropDownList>
                    </div>
                    <div class="provinceSearch_HomePage">
                        <asp:Label ID="langProvince" runat="server" Text="<%$Resources:language, langProvince%>"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlProvince" runat="server" Width="150px">
                        </asp:DropDownList>
                    </div>
                    <div class="minPrice_HomePage">
                        <asp:Label ID="langMinPrice" runat="server" Text="<%$Resources:language, langMinPrice%>"></asp:Label>
                        <br />
                        <asp:TextBox ID="tbxMinPrice" runat="server" Width="150px" MaxLength="10"></asp:TextBox>
                        vnd
                    </div>
                    <div class="maxPrice_HomePage">
                        <asp:Label ID="langMaxPrice" runat="server" Text="<%$Resources:language, langMaxPrice%>"></asp:Label>
                        <br />
                        <asp:TextBox ID="tbxMaxPrice" runat="server" Width="150px" MaxLength="10"></asp:TextBox>
                        vnd
                    </div>
                    <asp:ImageButton ID="imgBtnSearch" runat="server" OnClick="imgBtnSearch_Click" ValidationGroup="Search"
                        ImageUrl="~/WebData/Image/WebImage/Search-icon.png" ToolTip="Search"/>
                    <br />
                    <br />
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="tbxMinPrice"
                        ErrorMessage="<%$Resources:language, langMinPriceHigher0%>" ForeColor="Red" Operator="GreaterThanEqual"
                        SetFocusOnError="True" Type="Integer" ValueToCompare="0" Width="200px" ValidationGroup="Search"
                        Display="Dynamic"></asp:CompareValidator>
                    <br />
                    <asp:CompareValidator ID="CompareValidator3" runat="server" ErrorMessage="<%$Resources:language, langMaxPriceHigher0%>"
                        ControlToValidate="tbxMaxPrice" ForeColor="Red" Operator="GreaterThanEqual" Type="Integer"
                        ValueToCompare="0" SetFocusOnError="True" Width="200px" ValidationGroup="Search"
                        Display="Dynamic"></asp:CompareValidator>
                    <br />
                    <asp:CompareValidator ID="CompareValidator4" runat="server" ControlToCompare="tbxMinPrice"
                        ControlToValidate="tbxMaxPrice" ErrorMessage="<%$Resources:language, langMaxPriceHigherMinPrice%>"
                        ForeColor="Red" Operator="GreaterThanEqual" Type="Integer" Width="200px" ValidationGroup="Search"
                        Display="Dynamic"></asp:CompareValidator>
                    </form>
                </div>
                <div class="mainTradingNews">
                    <div class="mainTable_trading">
                        <asp:Label class="trading_heading" ID="langPostTableHomePage" runat="server" Text="<%$Resources:language, langPostTableHomePage%>"></asp:Label>
                        <div class="leftSide" style="display: inline-block;">
                            <asp:RadioButton ID="rbtPrice" GroupName="Sort" runat="server" Text="<%$Resources:language, langPrice%>"
                                AutoPostBack="True" OnCheckedChanged="rbtPrice_CheckedChanged" />
                            <asp:RadioButton ID="rbtTime" GroupName="Sort" runat="server" Text="<%$Resources:language, langTime%>"
                                Checked="true" AutoPostBack="True" OnCheckedChanged="rbtTime_CheckedChanged" />
                            <br />
                        </div>
                        <br />
                        <br />
                        <asp:Label ID="lblPostsMess" runat="server" ForeColor="Red"></asp:Label>
                        <asp:GridView ID="dgvPosts" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
                            AutoGenerateColumns="False" PageSize="20" Style="width: 100%;" BorderColor="#339933"
                            BorderStyle="Solid" BorderWidth="1px">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="PostID" HeaderText="PostID" Visible="False" />
                                <asp:BoundField DataField="UserID" HeaderText="UserID" Visible="False" />
                                <asp:HyperLinkField DataNavigateUrlFields="PostID" DataNavigateUrlFormatString="~/PRL.Trading/PostInfoPage.aspx?postID={0}"
                                    DataTextField="RiceType" HeaderText="Loại gạo" SortExpression="RiceType">
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:HyperLinkField>
                                <asp:BoundField DataField="Amount" HeaderText="Số lượng (kg)" SortExpression="Amount">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Price" HeaderText="Giá bán (vnđ)" SortExpression="Price">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Province" HeaderText="Tỉnh/TP" SortExpression="Province">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="CreateDate" HeaderText="Ngày đăng" SortExpression="CreateDate">
                                    <HeaderStyle HorizontalAlign="Right" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </asp:BoundField>
                            </Columns>
                            <EditRowStyle BackColor="#7C6F57" />
                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#cbfa84" Height="30px" />
                            <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" Font-Bold="True" />
                            <SortedAscendingCellStyle BackColor="#F8FAFA" />
                            <SortedAscendingHeaderStyle BackColor="#246B61" />
                            <SortedDescendingCellStyle BackColor="#D4DFE1" />
                            <SortedDescendingHeaderStyle BackColor="#15524A" />
                        </asp:GridView>
                        <br />
                        <asp:ImageButton ID="imgBtnFirst" runat="server" ImageUrl="~/WebData/Image/WebImage/First.png"
                            CommandArgument='First' OnClick="Page_Changed" ToolTip="First" />
                        <asp:ImageButton ID="imgBtnPrevious" runat="server" ImageUrl="~/WebData/Image/WebImage/Previous.png"
                            CommandArgument='Previous' OnClick="Page_Changed" ToolTip="Previous" />
                        <asp:Label ID="lblCurrentPage" runat="server" Text="Label"></asp:Label>
                        <asp:Label ID="lblSeperate" runat="server" Text="/"></asp:Label>
                        <asp:Label ID="lblTotalPage" runat="server" Text="Label"></asp:Label>
                        <asp:ImageButton ID="imgBtnNext" runat="server" ImageUrl="~/WebData/Image/WebImage/Next.png"
                            CommandArgument='Next' OnClick="Page_Changed" ToolTip="Next" />
                        <asp:ImageButton ID="imgBtnLast" runat="server" ImageUrl="~/WebData/Image/WebImage/Last.png"
                            CommandArgument='Last' OnClick="Page_Changed" ToolTip="Last" />
                        <br />
                        <br />
                    </div>
                    <div class="mainTable_news">
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/PRL.News/MarketNewsPage.aspx">
                        <h2>
                            <asp:Label class="news_heading" ID="langNewest" runat="server" Text="<%$Resources:language, langNewest%>"></asp:Label></h2>
                    </asp:HyperLink>
                    <asp:Repeater ID="tblNewsInfo" runat="server">
                        <ItemTemplate>
                            <div class="block_news">
                                <div class="news">
                                    <h4 class="title_news">
                                        <a href="PRL.News/MarketNewsDetailPage.aspx?newsID=<%# Eval("ID") %>">
                                            <%# Eval("Title") %></a>
                                    </h4>
                                    <br />
                                    <div class="content_left_news">
                                        <img class="picture_news" src="<%# Eval("Image") %>" alt="">
                                    </div>
                                    <p class="description_news">
                                        "<%# Eval("BriefContent")%></p>
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                </div>
                <div class="mainTable_rice">
                        <asp:Label class="rice_heading" ID="langPriceMarket" runat="server" Text="<%$Resources:language, langPriceMarket%>"></asp:Label>
                        <br />
                        (<asp:Label ID="langlblSource" runat="server" Text="Label"></asp:Label>:<asp:Label style="margin-left:10px;" ID="lblSource" runat="server" Text="Label"></asp:Label>)
                        <asp:GridView ID="dgvRicePrice" runat="server" CellPadding="4" AutoGenerateColumns="False"
                            BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="2px">
                            <Columns>
                                <asp:BoundField DataField="RiceType" HeaderText="Loại gạo">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="UpdatePrice" HeaderText="Giá cập nhật (vnđ)">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" Width="50px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Change" HeaderText="Thay đổi (%)">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" Width="40px" />
                                </asp:BoundField>
                                <asp:ImageField DataImageUrlField="Status">
                                </asp:ImageField>
                                <asp:BoundField DataField="OldPrice" Visible="False">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="UpdateTime" HeaderText="Ngày cập nhật">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" Width="60px" />
                                </asp:BoundField>
                            </Columns>
                            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                            <RowStyle BackColor="White" ForeColor="#330099" Height="40px" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                            <SortedAscendingCellStyle BackColor="#FEFCEB" />
                            <SortedAscendingHeaderStyle BackColor="#AF0101" />
                            <SortedDescendingCellStyle BackColor="#F6F0C0" />
                            <SortedDescendingHeaderStyle BackColor="#7E0000" />
                        </asp:GridView>
                    </div>
            </td>
        </tr>
    </tbody>
</asp:Content>
